package com.mingqijia.gassafety.job.controller;

import com.gap.basic.base.CommonResponse;
import com.mingqijia.gassafety.job.request.*;
import com.mingqijia.gassafety.job.response.*;
import com.mingqijia.gassafety.job.service.impl.EquipmentServiceImpl;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 表格导出,内部接口
 *
 * @author wanghai
 * @since 2022-02-23
 */

@Slf4j
@RestController
@RequestMapping("/inner/v1/equipment")
public class EquipmentController {
    @Autowired
    EquipmentServiceImpl equipmentService;

    /**
     * 设备详情
     * @return
     */
    @PostMapping("detail")
    @ApiOperation(value = "设备详情")
    public CommonResponse<EquipmentDetailResponse> detail(@RequestBody @Valid EquipmentDetailRequest request) {
        return CommonResponse.success(equipmentService.detail(request.getImei()));
    }
}
